﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//using UFIDA.U8.Cust.Public.Eorr;
//using UFIDA.U8.Cust.Public.UserInfor;

namespace AnLianSysClient
{
    public partial class MainFrm : DevExpress.XtraEditors.XtraForm
    {

        
        private frmdbset dbsetfrm;  //系统设置
        private frmProject projectfrm;    //项目档案
        private frmCustomer Customerfrm;      //客户档案 
        private frmSupplier supplierfrm;      //供应商档案 
        private frmConstruction constructionfrm;      //供应商档案 
        private BankDetailFrm BankDetailfrm;  //资金流水 
        private frmCA cafrm;    //折旧分摊
       
        public MainFrm()
        {
            //测试日志 
            InitializeComponent();
        }

        //设置状态栏登陆信息
        private void SetStatusBarInfo() {
            edtDate.Caption = DateTime.Now.ToShortDateString(); 
        }

        //
        private void MainFrm_Load(object sender, EventArgs e)
        {
            SetStatusBarInfo();
            barGpReport.Expanded = true;
            barGpSet.Expanded = false;
            barGpbd.Expanded = false;
            //this.barItemAutoInput_LinkClicked(this, null);
        }
        
       
        //退出
        private void btnCancel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Close();
        }

        //基础设置组
        private void btnSet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            barGpSet.Expanded = true;
            barGpbd.Expanded = false;
            barGpReport.Expanded = false;
        }

         
        private void barItemWar_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (dbsetfrm == null || dbsetfrm.IsDisposed)
            {
                dbsetfrm = new frmdbset();
                dbsetfrm.MdiParent = this;
            }
            dbsetfrm.Show();
            dbsetfrm.Focus();
        }

        private void btnBd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            barGpSet.Expanded = false;
            barGpbd.Expanded = true;
            barGpReport.Expanded = false;
        }

        private void btnReport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            barGpSet.Expanded = false;
            barGpbd.Expanded = false;
            barGpReport.Expanded = true;
        }

        private void btnProject_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (projectfrm == null || projectfrm.IsDisposed)
            {
                projectfrm = new frmProject();
                projectfrm.MdiParent = this;
            }
            projectfrm.Show();
            projectfrm.Focus();
        }

        private void btnCustomer_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (Customerfrm == null || Customerfrm.IsDisposed)
            {
                Customerfrm = new frmCustomer();
                Customerfrm.MdiParent = this;
            }
            Customerfrm.Show();
            Customerfrm.Focus();
        }
         

        private void navBarItem4_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (BankDetailfrm == null || BankDetailfrm.IsDisposed)
            {
                BankDetailfrm = new BankDetailFrm();
                BankDetailfrm.MdiParent = this;
            }
            BankDetailfrm.Show();
            BankDetailfrm.Focus();
        }
         
         

        private void BtnZJFT_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (cafrm == null || cafrm.IsDisposed)
            {
                cafrm = new frmCA();
                cafrm.MdiParent = this;
            }
            cafrm.Show();
            cafrm.Focus();
        }

        private void BtnContruction_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (constructionfrm == null || constructionfrm.IsDisposed)
            {
                constructionfrm = new frmConstruction();
                constructionfrm.MdiParent = this;
            }
            constructionfrm.Show();
            constructionfrm.Focus();
        }

        private void BtnBankDetail_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (BankDetailfrm == null || BankDetailfrm.IsDisposed)
            {
                BankDetailfrm = new BankDetailFrm();
                BankDetailfrm.MdiParent = this;
            }
            BankDetailfrm.Show();
            BankDetailfrm.Focus();
        }

        private void BtnSupplier_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (supplierfrm == null || supplierfrm.IsDisposed)
            {
                supplierfrm = new frmSupplier();
                supplierfrm.MdiParent = this;
            }
            supplierfrm.Show();
            supplierfrm.Focus();
        }
         

    }
}
